{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "50d8301c",
   "metadata": {},
   "outputs": [],
   "source": [
    "path= r\"E:\\pycharm_out\\yufa\\git_test\\a.txt\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "f9d9335a",
   "metadata": {},
   "outputs": [],
   "source": [
    "data ={'ab':123}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "47451aab",
   "metadata": {},
   "outputs": [],
   "source": [
    "data2 =(1,2,3,4,54)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "7f615531",
   "metadata": {},
   "outputs": [],
   "source": [
    "data3 =[1,2,3,4,54]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "2de6f33e",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(path,'w',encoding='utf8') as w:\n",
    "    w.write(str(data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "128098c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(path,'w',encoding='utf8') as w:\n",
    "    w.write(str(data2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "4d665d0a",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(path,'w',encoding='utf8') as w:\n",
    "    w.write(str(data3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "398712fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'[1, 2, 3, 4, 54]'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = None\n",
    "with open(path,'r',encoding='utf8') as r:\n",
    "    a = r.read()\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "cc22265e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = int(a)\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "a06fb8fc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, 4, 54]"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b1 = eval(a)\n",
    "b1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "a81e026a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "list"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(b1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "f59fdcdd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "eval('print(\"1\")')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1621c4f6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
